/*
 * Copyright(C) 2013-2017 AZ ALL Rights Reserved.
 *
 * FileName: Console
 * 
 * Description: xxxxx
 *
 * History:
 * 版本号                作者      日期      操作
 * 1.0       ZhouFan             2017/10/17 0017   
 *  
 */
package com.az.shiro.ice.console;

import com.az.shiro.ice.spring.ApplicationContextInstance;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.LockedAccountException;
import org.apache.shiro.authc.UnknownAccountException;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.File;
import java.io.PrintStream;
import java.util.Scanner;

/**
 * @author ZhouFan
 * @version 1.0
 * @date 2017/10/17 0017
 * @see
 */
public class Console {

    private Scanner cin = new Scanner(System.in);

    private PrintStream printer = System.out;
    public static boolean isQuit;
    public static final String username_input_label = "请输入用户名>";
    public static final String password_input_label = "请输入密码>";
    public static final String incorrect_credentials_label = "密码错误!";
    public static final String none_account_label = "账号不存在！";
    public static final String account_locked_label = "账号被锁定";
    public static final String login_success_label = "登陆成功";
    public static final String contact_label = "联系管理员<lazyball@163.com>";

    public static final String LINE = "+------------------------------------------------------+";
    public static final String WORD_SEPARATOR = "\t|\t";

    public static final String CRLF = System.getProperty("line.separator");
    public static final String LINE_SEPARATOR = "+------------------------------------------------------+" + CRLF;

    public static final String command_list_label =
            LINE_SEPARATOR +
                    ">>>>Comand Line:" +CRLF +
                    "pwd : " + WORD_SEPARATOR + "当前目录" + CRLF +
                    "ls : " + WORD_SEPARATOR + "目录列表" + CRLF +
                    "download -p <remotePath> -l <localPath>" + WORD_SEPARATOR + "下载文件" + CRLF +
                    "upload -p <remotePath> -l <localPath>" + WORD_SEPARATOR + "上传文件" + CRLF +
                    "help" + WORD_SEPARATOR + "查看命令帮助" + CRLF +
                    LINE_SEPARATOR;

    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:app.xml");
    private String username;

    private String password;
    public static String TITLE = "" +
            LINE + CRLF +
            "+        样本管理系统          \n" + "+" +
            LINE;


    public void init() {
        printer.print(TITLE);
    }

    public String readCMD(String cmd) {
        return cin.nextLine();
    }

    public String readUsername() {
        return cin.nextLine();
    }

    public String readPassword() {
        return cin.nextLine();
    }


    public static void main(String[] args) {
        Console console = new Console();
    }

    public void println(Object info) {
        printer.println(info);
    }
}

 